package com.cap9.config;

import com.cap9.dao.TestDao;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@Configuration
@ComponentScan({"com.cap9.controller", "com.cap9.service", "com.cap9.dao", "com.cap9.bean"})
public class Cap9MainConfig {
    @Bean
    @Primary// spring进行自装配的时候默认首选的bean
    public TestDao testDao2() {
        TestDao testDao = new TestDao();
        testDao.setFlag("2");
        return testDao;
    }
}
